import org.junit.Assert

navigate(testCaseUrl)

find "\$btn1"
assertNotNull()
assertEquals("Button1", widget.label)
assertEquals("zul.wgt.Button", widget.className)

click()
find("@window .z-label")
assertNotNull()
assertEquals("Hello Button1", widget.value)

find("@window @button")
assertNotNull()
click(1,1000)
find("@window .z-label",0)
assertNull()

//test dbclick and right click
btn1 = find("\$btn1")
btn1.dbclick(0,0)
waitForTrip(1,500)
assertNull(find("@window .z-label",0))
btn1.rclick(0,0)
waitForTrip(1,500)
assertNull(find("@window .z-label",0))


find("\$btn2")
assertNotNull()
assertEquals("Button2", widget.label)
assertEquals("zul.wgt.Button", widget.className)

dbclick()
find("@window .z-label")
assertNotNull()
assertEquals("Hello Button2", widget.value)

find("@window @button")
assertNotNull()
click(1,1000)
find("@window .z-label",0)
assertNull()


find("\$btn3")
assertNotNull()
assertEquals("Button3", widget.label)
assertEquals("zul.wgt.Button", widget.className)

rclick()
find("@window .z-label")
assertNotNull()
assertEquals("Hello Button3", widget.value)

find("@window @button")
assertNotNull()
click(1,1000)
find("@window .z-label",0)
assertNull()

find("\$btn3")
assertNotNull()